import * as Mock from 'mockjs'
import { MockRequest } from '../types/mock'
import { builder } from '../util'

const info = (request: MockRequest) => {
  return builder({
    id: Mock.Random.id(),
    name: Mock.Random.cname(),
    token: Mock.Random.string()
  })
}

Mock.mock(/\/api\/user\/info/, 'get', info)
Mock.mock(/\/api\/auth\/login/, 'post', info)
